From d5461c7b296c1ee267cb68ea5ba9ef2e55cc7da1 Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Thu, 15 Dec 2005 13:49:07 +0000 Subject: [PATCH] Fix block_attach_shared tests. When the sharing check succeeds, the domain is created but left paused, so it is necessary to destroy the domain afterwards, whether the test succeeded or failed. Signed-off-by: Ewan Mellor --- .../tests/block-create/11_block_attach_shared_dom0.py | 2 ++ .../tests/block-create/12_block_attach_shared_domU.py | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py b/tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py index adf7ca5ea5..f2e5ca7d64 100644 --- a/tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py +++ b/tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py @@ -34,3 +34,5 @@ try: FAIL("Bug #331: Started a DomU with write access to a rw mounted block device") except DomainError, e: s, o = traceCommand("umount mnt") + +domain.destroy() diff --git a/tools/xm-test/tests/block-create/12_block_attach_shared_domU.py b/tools/xm-test/tests/block-create/12_block_attach_shared_domU.py index c0ce5bee8a..07cf56c373 100644 --- a/tools/xm-test/tests/block-create/12_block_attach_shared_domU.py +++ b/tools/xm-test/tests/block-create/12_block_attach_shared_domU.py @@ -20,8 +20,11 @@ except DomainError, e: FAIL("Unable to start domain") try: - dom2.start() - dom1.destroy() - FAIL("Bug #331: Started a DomU with write access to an in-use block device") -except DomainError, e: + try: + dom2.start() + FAIL("Bug #331: Started a DomU with write access to an in-use block device") + except DomainError, e: + pass +finally: dom1.destroy() + dom2.destroy() -- 2.30.2